<template>
 <div class="row">
   <div class="col-12" v-for="item in getList(this.catId)" :key="item.id">
     <div v-if="item.setting.choice == 1">
<a v-if="item.setting.is_title == 1 && item.url.length > 0" :href="item.url" target="_blank">{{item.title}}</a>
<a v-if="item.setting.is_thumb == 1 && item.url.length > 0" :href="item.url" target="_blank"><img :src="item.loge"></a>
<router-link v-if="item.setting.is_title == 1 && item.url.length == 0" :to="'/advert/'+ item.id">{{item.title}}</router-link>
<router-link v-if="item.setting.is_thumb == 1 && item.url.length == 0" :to="'/advert/'+ item.id"><img :src="item.loge"></router-link>
     </div>
     <div v-else v-html="item.content">

     </div>
   </div>
 </div>
</template>
<script>
import { mapState, mapGetters, mapActions } from "vuex";
export default {
  name: 'Advert',
  props: ['catId'],
  created () {
    console.log(this.catId)
    this.setList(this.catId)
    console.log('aaa', this.getList(this.catId))
  },
  computed: {
    ...mapGetters("advert", ['getList'])
  },
  methods: {
    ...mapActions("advert", ['setList'])
  }
}
</script>
